//
//  JSTAdvertAchieved.m
//  JSTWebMobClick
//
//  Created by 01 on 16/10/9.
//  Copyright © 2016年 czj. All rights reserved.
//

#import "JSTAdvertAchieved.h"
#import "JSTHttpClient.h"
#import "KYReachability.h"
#import "JSTFMDBManager.h"
#import "JSTConfig.h"

@interface JSTAdvertAchieved ()

@property (nonatomic, strong) NSString *advertId;

@end

@implementation JSTAdvertAchieved

- (void)getAdvertId:(NSString *)advertId jsStr:(void (^)(NSString *))jsStr
{
    [JSTServer requestAdvertStyleData:advertId Success:^(NSDictionary *successDic) {
        if ([successDic[@"typeid"] isEqualToString:@"1000"] || [successDic[@"typeid"] isEqualToString:@"21"] ) return ;
        if (successDic[@"data"][@"iframejs"]) {
            NSString *js = successDic[@"data"][@"iframejs"];
            jsStr(js);
        }
    } err:^(NSString *errStr) {
    }];
}
//处理连接改变后的情况
- (BOOL) updateInterfaceWithReachability: (KYReachability *) curReach
{
    //对连接改变做出响应的处理动作。
    NetworkStatus status = [curReach currentReachabilityStatus];
    
    if(status == ReachableViaWWAN || status == ReachableViaWiFi)
    {
        DLog(@"------------- 当前网络链接正常 检测可正常请求");
        return YES;
    }else
    {
        DLog(@"------------- 当前无网络");
        return NO;
    }
}


@end
